/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.infotypes;

import robocup.component.DAInamiteConstants;

/**
 * In addition to VisualObjectInfo, a DynamicObjectInfo contains distchange and
 * dirchange information, which are the values that are best for calculating
 * the motion of mobile objects.
 */
public class DynamicObjectInfo extends VisualObjectInfo {

	/**
	 * The value, by which the distance to the seen object changes from the
	 * current to the next cycle.
	 */
	private double distChange;

	/**
	 * The value, by which the direction to the seen object changes from the
	 * current to the next cycle.
	 */
	private double dirChange;

	/**
	 * Creates an info-object for a mobile object (player/ball)
	 * 
	 * @param cycle -
	 *            the time, when it was seen
	 * @param id -
	 * @param iDistance -
	 *            the distance to the seen object
	 * @param iDirection -
	 *            the direction (relative) to the seen object
	 * @param iDistchange -
	 *            the distance change (used for speed calculation)
	 * @param iDirchange -
	 *            the direction change (used for speed calculation)
	 */
	public DynamicObjectInfo(int cycle, int id, double iDistance,
			double iDirection, double iDistchange, double iDirchange) {
		super(cycle, id, iDistance, iDirection);
		this.distChange = iDistchange;
		this.dirChange = iDirchange;
	}

	/**
	 * @return true if dir|dist-change is given else false
	 */
	public boolean velocitySeen() {
		return (this.distChange != DAInamiteConstants.DOUBLE_UNKNOWN && this.dirChange != DAInamiteConstants.DOUBLE_UNKNOWN);
	}

	/**
	 * @return Returns the direction-change value.
	 */
	public double getDirChange() {
		return this.dirChange;
	}

	/**
	 * Sets a new direction-change value.
	 * @param dirChange
	 */
	public void setDirChange(double dirChange) {
		this.dirChange = dirChange;
	}

	/**
	 * @return Returns the distance-change value.
	 */
	public double getDistChange() {
		return this.distChange;
	}

	/**
	 * Sets a new distance-change value.
	 * @param distChange
	 */
	public void setDistChange(double distChange) {
		this.distChange = distChange;
	}
}
